package cn.zz.veggie.model.domain;

import cn.zz.comm.mybaits.types.BaseEntity;
import cn.zz.veggie.core.enums.biz.OrderStatus;
import lombok.Getter;
import lombok.Setter;

/**
 * 订单表(Order)实体类
 *
 * @author zhongq
 * @since 2024-05-25 15:14:55
 */
@Getter
@Setter
public class Order extends BaseEntity {
	private String sn;
	private Integer shopId;
	private Integer status;
	private Integer amount;
	private String address;
	private String remark;
	private Integer delManId;
	private Long deliveryTime;

	public void putStatus(OrderStatus status) {
		this.status = status.status;
	}

	public Order changeAmount(Integer amount) {
		final Order order = new Order();
		order.id = id;
		order.amount = this.amount + amount;
		return order;
	}

	public Order delete() {
		final Order order = new Order();
		order.id = id;
		order.status = OrderStatus.deleted.status;
		return order;
	}

}